package com.example.administrator.circle;

import android.graphics.Color;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;

import java.util.Timer;
import java.util.TimerTask;

import android.os.Handler;
import android.os.Message;

public class MainActivity extends AppCompatActivity {
    DrawView drawView = null;
    Timer timer = new Timer();
    Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            if (msg.what == 0x123) {
                //drawView.ControlByWheel();
                drawView.Control();
            }
            super.handleMessage(msg);
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        drawView = (DrawView) findViewById(R.id.drawview);
        timer.schedule(new TimerTask() {
            public void run() {
                handler.sendEmptyMessage(0x123);
            }
        }, 0, 150);
    }
}

